﻿<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link href="~/css/table.css" rel="stylesheet" />
    <link href="~/css/cwcalendar.css" rel="stylesheet" />
    <script src="~/javascript/comm/comm.js"></script>
    <script src="~/javascript/comm/list.js"></script>
    <script src="~/javascript/calendar-ch.js"></script>
    <script src="~/javascript/jquery-1.7.2.js"></script>
    <script src="~/javascript/locate.js"></script>
    <script src="~/javascript/select.js"></script>

    <script type="text/javascript">
        window.onload = check;
        function tick() {
            var now = new Date();
            var hours, minutes, seconds, noon;
            var intHours, intMinutes, intSeconds;
            intHours = now.getHours();
            intMinutes = now.getMinutes();
            intSeconds = now.getSeconds();
            if (intHours < 24) {
                hours = intHours + ":";
                noon = "A.M.";
            } else {
                intHours = intHours - 24;
                hours = intHours + ":";
                noon = "P.M.";
            }
            if (intMinutes < 10) {
                minutes = "0" + intMinutes + ":";
            } else {
                minutes = intMinutes + ":";
            }
            if (intSeconds < 10) {
                seconds = "0" + intSeconds + " ";
            } else {
                seconds = intSeconds + " ";
            }
            timeString = hours + minutes + seconds;
            var now = new Date();
            document.getElementById("regist_time").value = now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + now.getDate() + " " + timeString;
            window.setTimeout("tick();", 1000);
        }
        //load事件
        function check() {
            //获得系统当前时间的方法
            tick();
        }
    </script>
</head>
<body>
    <div id="app">
        <form id="form1">
            <table width="100%">
                <tr>
                    <td>
                        <font color="black">您正在做的业务是：人力资源--招聘管理--简历管理--简历登记 </font>

                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <input type="button" value="提交" class="BUTTON_STYLE1" v-on:click="Add()">
                        <input type="reset" value="清除" class="BUTTON_STYLE1">
                    </td>
                </tr>
            </table>
            <table width="100%" border="1" cellpadding=0 cellspacing=1
                   bordercolorlight=#848284 bordercolordark=#eeeeee
                   class="TABLE_STYLE1">
                <tr>
                    <td class="TD_STYLE1">
                        职位分类
                    </td>
                    <td class="TD_STYLE2">
                        @if (@ViewData["major_kind_id"] != null)
                        {
                            <input type="hidden" name="human_major_kind_id" id="human_major_kind_id" v-model="human_major_kind_id" value="@ViewData["major_kind_id"]" class="INPUT_STYLE2" readonly>
                            <input type="text" name="human_major_kind_name" id="human_major_kind_name" value="@ViewData["major_kind_name"]" class="INPUT_STYLE2" readonly>
                        }
                        else
                        {
                            <select name="human_major_kind_id" id="human_major_kind_id" v-model="human_major_kind_id" class="INPUT_STYLE1">
                                <option v-for="(item,index) in majorKindlist" v-on:click="Getmajor(item.major_kind_id)" :value="item.major_kind_id">{{item.major_kind_name}}</option>
                            </select>
                            <input id="human_major_kind_name" name="human_major_kind_name" hidden="hidden" v-model="human_major_kind_name" value="" />
                        }
                        @*<input hidden="hidden" id="human_major_kind_name" name="human_major_kind_name" v-model="human_major_kind_name" />
        <select name="human_major_kind_id" id="human_major_kind_id" v-model="human_major_kind_id" class="INPUT_STYLE1">
            <option v-for="(item,index) in majorKindlist" v-on:click="Getmajor(item.major_kind_id)" :value="item.major_kind_id">{{item.major_kind_name}}</option>
        </select>*@
                    </td>
                    <td class="TD_STYLE1">
                        职位名称
                    </td>
                    <td class="TD_STYLE2">
                        @if (@ViewData["major_id"] != null)
                        {
                            <input type="hidden" name="human_major_id" id="human_major_id" value="@ViewData["major_id"]" class="INPUT_STYLE2" readonly>
                            <input type="text" name="human_major_name" id="human_major_name" value="@ViewData["major_name"]" class="INPUT_STYLE2" readonly>
                        }
                        else
                        {
                            <input hidden="hidden" id="human_major_name" name="human_major_name" v-model="human_major_name" />
                            <select name="human_major_id" id="human_major_id" v-model="human_major_id" class="INPUT_STYLE1">
                                <option v-for="(item,index) in majorlist" :value="item.major_id">{{item.major_name}}</option>
                            </select>
                        }
                    </td>
                    <td width="11%" class="TD_STYLE1">
                        招聘类型
                    </td>
                    <td class="TD_STYLE2" colspan="2">
                        <select name="engage_type" id="engage_type" class="SELECT_STYLE1" v-model="engage_type">
                            <option value="">--请选择--</option>

                            <option value="校园招聘">校园招聘</option>

                            <option value="社会招聘">社会招聘</option>

                        </select>

                    </td>
                    <td rowspan="6">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td class="TD_STYLE1">
                        姓名
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" name="human_name" id="human_name" v-model="human_name" class="INPUT_STYLE2" />
                    </td>
                    <td class="TD_STYLE1">
                        性别
                    </td>
                    <td class="TD_STYLE2">
                        <select name="human_sex" id="human_sex" v-model="human_sex" class="SELECT_STYLE1">
                            <option value="男">男</option>
                            <option value="女">女</option>
                        </select>
                    </td>
                    <td class="TD_STYLE1">
                        EMAIL
                    </td>
                    <td colspan="2" class="TD_STYLE2">
                        <input type="text" name="human_email" id="human_email" v-model="human_email" class="INPUT_STYLE2">
                    </td>
                </tr>
                <tr>
                    <td class="TD_STYLE1">
                        电话
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" name="human_telephone" id="human_telephone" v-model="human_telephone" class="INPUT_STYLE2">
                    </td>
                    <td class="TD_STYLE1">
                        家庭电话
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" name="human_homephone" id="human_homephone" v-model="human_homephone" class="INPUT_STYLE2">
                    </td>
                    <td class="TD_STYLE1">
                        手机
                    </td>
                    <td colspan="2" class="TD_STYLE2">
                        <input type="text" name="human_mobilephone" id="human_mobilephone" v-model="human_mobilephone" class="INPUT_STYLE2">
                    </td>
                </tr>
                <tr>
                    <td class="TD_STYLE1">
                        住址
                    </td>
                    <td colspan="3" class="TD_STYLE2">
                        <input type="text" name="human_address" id="human_address" v-model="human_address" class="INPUT_STYLE2">
                    </td>

                    <td class="TD_STYLE1">
                        邮编
                    </td>
                    <td colspan="2" class="TD_STYLE2">
                        <input type="text" name="human_postcode" id="human_postcode" v-model="human_postcode" class="INPUT_STYLE2">
                    </td>
                </tr>

                <tr>
                    <td class="TD_STYLE1">
                        国籍
                    </td>
                    <td class="TD_STYLE2">
                        <select name="human_nationality" id="human_nationality" v-model="human_nationality" class="SELECT_STYLE1">
                            <option value="">--请选择--</option>

                            <option value="中国">中国</option>

                            <option value="美国">美国</option>

                        </select>
                    </td>
                    <td class="TD_STYLE1">
                        出生地
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" name="human_birthplace" id="human_birthplace" v-model="human_birthplace" class="INPUT_STYLE2">
                    </td>
                    <td class="TD_STYLE1">
                        生日
                    </td>
                    <td width="13%" colspan="2" class="TD_STYLE2">
                        <input type="text" name="human_birthday" id="human_birthday" readonly="readonly" @*onclick="WdatePicker()"*@ v-model="human_birthday" class="INPUT_STYLE2">
                    </td>

                </tr>
                <tr>
                    <td width="11%" class="TD_STYLE1">
                        民族
                    </td>
                    <td class="TD_STYLE2" width="14%">
                        <select name="human_race" id="human_race" v-model="human_race" class="SELECT_STYLE1">
                            <option value="">--请选择--</option>

                            <option value="汉族">汉族</option>

                            <option value="回族">回族</option>

                        </select>
                    </td>
                    <td class="TD_STYLE1">
                        宗教信仰
                    </td>
                    <td class="TD_STYLE2">
                        <select name="human_religion" id="human_religion" v-model="human_religion" class="SELECT_STYLE1">

                            <option value="无">无</option>

                            <option value="佛教">佛教</option>

                        </select>
                    </td>
                    <td class="TD_STYLE1">
                        政治面貌
                    </td>
                    <td class="TD_STYLE2" colspan="2">
                        <select name="human_party" id="human_party" v-model="human_party" class="SELECT_STYLE1">
                            <option value="">--请选择--</option>

                            <option value="党员">党员</option>

                            <option value="群众">群众</option>

                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="TD_STYLE1">
                        身份证号码
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" name="human_idcard" v-model="human_idcard" id="human_idcard" v-on:blur="yz()" class="INPUT_STYLE2">
                    </td>
                    <td class="TD_STYLE1">
                        年龄
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" name="human_age" id="human_age" v-model="human_age" class="INPUT_STYLE2">
                    </td>
                    <td class="TD_STYLE1">
                        毕业院校
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" name="human_college" id="human_college" v-model="human_college"  class="INPUT_STYLE2" />
                    </td>

                    <td class="TD_STYLE1">
                        学历
                    </td>
                    <td class="TD_STYLE2">
                        <select name="human_educated_degree" id="human_educated_degree" v-model="human_educated_degree" class="SELECT_STYLE1">
                            <option value="">--请选择--</option>

                            <option value="本科">本科</option>

                            <option value="大专">大专</option>

                        </select>
                    </td>

                </tr>
                <tr>
                    <td class="TD_STYLE1">
                        教育年限
                    </td>
                    <td class="TD_STYLE2">
                        <select name="human_educated_years" id="human_educated_years" v-model="human_educated_years" class="SELECT_STYLE1">
                            <option value="">--请选择--</option>

                            <option value="12">12</option>

                            <option value="16">16</option>

                        </select>
                    </td>
                    <td class="TD_STYLE1">
                        学历专业
                    </td>
                    <td class="TD_STYLE2">
                        <select name="human_educated_major" id="human_educated_major" v-model="human_educated_major" class="SELECT_STYLE1">
                            <option value="">--请选择--</option>

                            <option value="生物工程">生物工程</option>

                            <option value="计算机">计算机</option>

                        </select>
                    </td>

                    <td class="TD_STYLE1">
                        薪酬要求
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" name="demand_salary_standard" id="demand_salary_standard" v-model="demand_salary_standard" class="INPUT_STYLE2" />
                    </td>
                    <td class="TD_STYLE1">
                        注册时间
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" name="regist_time"
                               id="regist_time" v-model="regist_time" readonly="readonly"
                               class="INPUT_STYLE2">
                    </td>

                </tr>
                <tr>

                    <td class="TD_STYLE1">
                        特长
                    </td>
                    <td class="TD_STYLE2">
                        <select name="human_specility" id="human_specility" v-model="human_specility" class="SELECT_STYLE1">
                            <option value="">--请选择--</option>

                            <option value="数据库">数据库</option>

                            <option value="java">java</option>

                            <option value=".net">.net</option>

                        </select>

                    </td>
                    <td class="TD_STYLE1">
                        爱好
                    </td>
                    <td class="TD_STYLE2">
                        <select name="human_hobby" id="human_hobby" v-model="human_hobby" class="SELECT_STYLE1">
                            <option value="">--请选择--</option>

                            <option value="篮球">篮球</option>

                            <option value="舞蹈">舞蹈</option>

                            <option value="唱歌">唱歌</option>

                        </select>

                    </td>
                    <td class="TD_STYLE1">
                        &nbsp;
                    </td>
                    <td class="TD_STYLE2">
                        &nbsp;
                    </td>
                    <td class="TD_STYLE1">
                        &nbsp;
                    </td>
                    <td class="TD_STYLE2">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td class="TD_STYLE1">
                        个人履历
                    </td>
                    <td colspan="7" class="TD_STYLE2">
                        <textarea name="human_history_records" id="human_history_records" v-model="human_history_records" rows="4" class="TEXTAREA_STYLE1"></textarea>
                    </td>
                </tr>

                <tr>
                    <td class="TD_STYLE1">
                        备注
                    </td>
                    <td colspan="7" class="TD_STYLE2">
                        <textarea name="remark" id="remark" v-model="remark" rows="4" class="TEXTAREA_STYLE1"></textarea>
                    </td>
                </tr>
            </table>
        </form>

    </div>


</body>

</html>

<script type="text/javascript">
    var vm = new Vue({
        el: "#app",
        data: {
            majorKindlist: [],
            majorlist: [],
            first_kind_id: "",
            first_kind_name: "",
            second_kind_id: "",
            second_kind_name: "",
            third_kind_id: "",
            third_kind_name: "",
            engage_type: "",
            salary_standard_name: "",
            regist_time:"",
            human_name: "",
            human_address: "",
            human_postcode: "",
            human_pro_designation:"",
            human_major_kind_id: "",
            human_major_kind_name: "",
            human_major_id: "",
            hunma_major_name: "",
            human_telephone: "",
            human_homephone :"",
            human_mobilephone: "",
            human_email: "",
            human_hobby: "",
            human_specility: "",
            human_sex: "",
            human_religion: "",
            human_party: "",
            human_nationality: "",
            human_race: "",
            human_birthday: "",
            human_birthplace: "",
            human_age: "",
            human_educated_degree: "",
            human_educated_years: "",
            human_educated_major: "",
            human_college:"",
            human_idcard: "",
            remark: "",
            demand_salary_standard: "",
            human_history_records:""
        },
        methods: {
            load: function () {
                var t = this;
                $.ajax({
                    url: "/resume/GetAll",
                    type: "Post",
                    success: function (msg) {
                        var dts = eval("(" + msg + ")");
                        t.majorKindlist = dts["major_kind"];
                        t.majorlist = dts["major"];
                    }
                })
            },
            Getmajor: function (id) {
                var t = this;
                $.ajax({
                    url: "/resume/Getmajor",
                    type: "Post",
                    data: "id=" + id,
                    success: function (msg) {
                        var dts = eval(msg);
                        t.majorlist = dts;
                    }
                })
            },
            yz: function () {
                var date = new Date();
                var y = date.getFullYear();
                var sr;
                var xb;
                var bb;
                var s = $("#human_idcard").val();

                if (s.length != 15 && s.length != 18)//身份证号码只能为15位或18位其它不合法
                {
                    alert("身份证只能位15位或18位");
                    return;
                }
                sr = s.substring(6, 10) + "年" + s.substring(10, 12) + "月" + s.substring(12, 14) + "日";
                xb = s.substring(16, 17);

                if (xb % 2 == 0) {
                    bb = "女";
                } else {
                    bb = "男";
                }
                var nl = s.substring(6, 10);
                var hh = y - nl;


                this.xbb = bb;
                $("#human_birthday").val(sr);
                $("#human_sex").val(bb);

                $("#human_age").val(hh);


            },
            Add: function () {
                var human_major_kind_id = $("#human_major_kind_id option:selected").text();
                $("#human_major_kind_name").val(human_major_kind_id);
                var human_major_id = $("#human_major_id option:selected").text();
                $("#human_major_name").val(human_major_id);

                var human_name = $("#human_name").val();
                var human_address = $("#human_address").val();
                var human_postcode = $("#human_postcode").val();
                var human_pro_designation = $("#human_pro_designation").val();
                var human_telephone = $("#human_telephone").val();
                var human_mobilephone = $("#human_mobilephone").val();
                var human_homephone = $("#human_homephone").val();
                var human_email = $("#human_email").val();
                var human_hobby = $("#human_hobby").val();
                var human_sex = $("#human_sex").val();
                var human_specility = $("#human_specility").val();
                var human_religion = $("#human_religion").val();
                var human_party = $("#human_party").val();
                var human_nationality = $("#human_nationality").val();
                var human_race = $("#human_race").val();
                var human_birthday = $("#human_birthday").val();
                var human_birthplace = $("#human_birthplace").val();
                var human_age = $("#human_age").val();
                var human_educated_degree = $("#human_educated_degree").val();
                var human_educated_years = $("#human_educated_years").val();
                var human_educated_major = $("#human_educated_major").val();
                var human_idcard = $("#human_idcard").val();
                var demand_salary_standard = $("#demand_salary_standard").val();
                var human_history_records = $("#human_history_records").val();               
                var remark = $("#remark").val();
                if (engage_type == "" || human_name == "" || human_address == "" || human_postcode == "" || human_pro_designation == "" || human_homephone == "" || demand_salary_standard == "" || human_history_records == "" || human_telephone == "" || human_mobilephone == "" || human_email == "" || human_hobby == "" || human_specility == "" || human_sex == "" || human_religion == "" || human_party == "" || human_nationality == "" || human_race == "" || human_birthday == "" || human_birthplace == "" || human_age == "" || human_idcard  == "" || remark == "" || human_educated_degree == "" || human_educated_years == "" || human_educated_major =="") {
                    alert('请将信息填写完整！！！');
                    return false;
                }
                $.ajax({
                    url: "/resume/register",
                    type: "Post",
                    data: $("#form1").serialize(),
                    success: function (msg) {
                        if (msg > 0) {
                            alert('新增成功!');
                            window.location.href = '/resume/register';
                        } else {
                            alert('新增失败!');
                            window.location.href = '/resume/register';
                        }
                    }
                })
            }
        },
        mounted: function () {
            this.load();
        }
    })
</script>


